package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;

import com.bumptech.glide.Glide;

import java.util.List;

import flc.ast.BaseAc;
import flc.ast.HomeActivity;
import flc.ast.R;
import flc.ast.databinding.ActivityPicGridBinding;
import flc.ast.databinding.ActivityPicGridResultBinding;

public class PicGridResultActivity extends BaseAc<ActivityPicGridResultBinding> {

    public static List<String> listPath;

    @Override
    protected int onCreate() {
        return R.layout.activity_pic_grid_result;
    }

    @Override
    protected void initView() {
        mDataBinding.ivPicGridResultBack.setOnClickListener(v -> onBackPressed());

        mDataBinding.tvAgainCut.setOnClickListener(this);
        mDataBinding.tvComplete.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.tvAgainCut://继续裁切
                finish();
                break;
            case R.id.tvComplete://完成
                startActivity(HomeActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {
        Glide.with(mContext).load(listPath.get(0)).into(mDataBinding.ivImg1);
        Glide.with(mContext).load(listPath.get(1)).into(mDataBinding.ivImg2);
        Glide.with(mContext).load(listPath.get(2)).into(mDataBinding.ivImg3);
        Glide.with(mContext).load(listPath.get(3)).into(mDataBinding.ivImg4);
        Glide.with(mContext).load(listPath.get(4)).into(mDataBinding.ivImg5);
        Glide.with(mContext).load(listPath.get(5)).into(mDataBinding.ivImg6);
        Glide.with(mContext).load(listPath.get(6)).into(mDataBinding.ivImg7);
        Glide.with(mContext).load(listPath.get(7)).into(mDataBinding.ivImg8);
        Glide.with(mContext).load(listPath.get(8)).into(mDataBinding.ivImg9);
    }
}